//
//  CZQEidtJobView.m
//  coachmanage
//
//  Created by 众拳科技 on 2018/3/14.
//  Copyright © 2018年 众拳科技. All rights reserved.
//

#import "CZQEidtJobView.h"

@implementation CZQEidtJobView

-(id)initWithFrame:(CGRect)frame{
    
    self = [super initWithFrame:frame];
    
    if (self) {
        
        UIScrollView *scrollView = [[UIScrollView alloc] init];
        [self addSubview:scrollView];
        self.scrollView = scrollView;
        
        /**
         求职状态
         */
        CommonBtnView *jobStatuBtnView = [[CommonBtnView alloc] init];
        jobStatuBtnView.titleLabel.text = @"求职状态*";
        jobStatuBtnView.choseLabel.text = @"选择求职状态";
        jobStatuBtnView.choseLabel.textColor = PlaceHoldColor;
        [scrollView addSubview:jobStatuBtnView];
        self.jobStatuBtnView = jobStatuBtnView;
        
        /**
         期望职位
         */
        CommonBtnView *jobWorkBtnView = [[CommonBtnView alloc] init];
        jobWorkBtnView.titleLabel.text = @"期望职位*";
        jobWorkBtnView.choseLabel.text = @"选择期望职位";
        jobWorkBtnView.choseLabel.textColor = PlaceHoldColor;
        [scrollView addSubview:jobWorkBtnView];
        self.jobWorkBtnView = jobWorkBtnView;
        
        /**
         选择城市
         */
        CommonBtnView *addressBtnView = [[CommonBtnView alloc] init];
        addressBtnView.titleLabel.text = @"城市*";
        addressBtnView.choseLabel.text = @"选择城市";
        addressBtnView.choseLabel.textColor = PlaceHoldColor;
        [scrollView addSubview:addressBtnView];
        self.addressBtnView = addressBtnView;
        
        /**
         选择薪水
         */
        CommonBtnView *jobMoneyBtnView = [[CommonBtnView alloc] init];
        jobMoneyBtnView.titleLabel.text = @"期望薪水*";
        jobMoneyBtnView.choseLabel.text = @"选择期望薪水";
        jobMoneyBtnView.choseLabel.textColor = PlaceHoldColor;
        [scrollView addSubview:jobMoneyBtnView];
        self.jobMoneyBtnView = jobMoneyBtnView;
        
        [self setConstraints];
        
    }
    
    return self;
    
}

-(void)setConstraints{
    
    [self.scrollView mas_remakeConstraints:^(MASConstraintMaker *make) {
        
        make.edges.mas_equalTo(self);
    }];
    
    /**
     求职状态
     */
    [self.jobStatuBtnView mas_remakeConstraints:^(MASConstraintMaker *make) {
        
        make.top.mas_equalTo(self.scrollView);
        
        make.left.width.mas_equalTo(self);
    }];
    
    /**
     职位
     */
    [self.jobWorkBtnView mas_remakeConstraints:^(MASConstraintMaker *make) {
        
        make.top.mas_equalTo(self.jobStatuBtnView.mas_bottom).offset(10);
        
        make.left.width.mas_equalTo(self);
    }];
    
    /**
     地址
     */
    [self.addressBtnView mas_remakeConstraints:^(MASConstraintMaker *make) {
        
        make.top.mas_equalTo(self.jobWorkBtnView.mas_bottom);
        
        make.left.width.mas_equalTo(self);
    }];
    
    /**
     期望薪资
     */
    [self.jobMoneyBtnView mas_remakeConstraints:^(MASConstraintMaker *make) {
        
        make.top.mas_equalTo(self.addressBtnView.mas_bottom);
        
        make.left.width.mas_equalTo(self);
    }];
}

-(void)layoutSubviews{
    
    self.scrollView.contentSize = CGSizeMake(self.width, self.jobMoneyBtnView.bottom + CZQ_StatusBarHeight + CZQ_NavigationBarHeight);
}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
